package com.joysuch.wwyt.edu.schedule;

import com.alibaba.fastjson.JSON;
import com.joysuch.wwyt.edu.bean.EduCourseRedisDto;
import com.joysuch.wwyt.edu.entity.EduCourseLearnHistory;
import com.joysuch.wwyt.edu.service.EduCourseStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author xsx
 * @version 1.0
 * @date 2023/4/10 16:29
 */
@Component
@Slf4j
public class EduLearnSchedule {

    @Autowired
    private EduCourseStatisticsService eduCourseStatisticsService;

    /**
     * 生成文档学习记录(异常中断退出)
     * 每天1点15分执行
     */
    @Scheduled(cron = "0 15 1 ? * *")
    public void task(){
        eduCourseStatisticsService.saveLearnHistory();
    }
}
